import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/login/Login.vue"
import Layout from "@/views/layout/Layout.vue"
import Home from "@/views/home/Home.vue"
import Account from "@/views/person/Account.vue"
import UpdatePwd from "@/views/person/UpdatePwd.vue"
import Ranch from "@/views/baseManager/Ranch.vue"
import ColonyHouse from "@/views/baseManager/ColonyHouse.vue"
import Register from "@/views/register/Register.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/layout',
    redirect: '/home',
    component: Layout,
    children: [
      {
        path: '/home',
        name: '首页',
        component: Home
      },
      {
        path: '/account',
        name: '账号管理',
        component: Account
      },
      {
        path: '/updatepwd',
        name: '修改密码',
        component: UpdatePwd
      },
      {
        path: '/ranch',
        name: '牧场管理',
        component: Ranch
      },
      {
        path: '/colonyhouse',
        name: '圈舍管理',
        component: ColonyHouse
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
